﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SetForCurrentUser.aspx.cs"
    Inherits="PPAP.Web.Substitutes.SetForCurrentUser" %>

<%@ Register Assembly="PPAP.WebControls" Namespace="PPAP.WebControls" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="../Common/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script language="javascript">
        function Del(id) {
            url = "SetForCurrentUser.aspx?SID=" + id;
            if (confirm('Delete?')) {
                //alert(url);
                window.location.href = url;
            }
        }
    </script>
</head>
<body style="font-family: Arial, Helvetica, sans-serif;">
    <form id="form1" runat="server">
    <font size='-1' color='gray'>Current position:Substitutes>>Substitutes</font>
    <div>
        <table width="650px">
            <tr>
                <td colspan="2" style="font-weight: bold; color: #2E8AC5; font-size: larger;" bgcolor="#E7E8E8">
                    Substitutes setup
                </td>
            </tr>
            <tr runat="server" id="tr1" visible="false">
                <td bgcolor="#E7E8E8" style="width: 200px; font-weight: bold;">
                    Department :
                </td>
                <td bgcolor="#E7E8E8">
                    <asp:DropDownList ID="ddlDepartment" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlDepartment_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr runat="server" id="tr2" visible="false">
                <td bgcolor="#E7E8E8" style="width: 200px; font-weight: bold;">
                    User:
                </td>
                <td bgcolor="#E7E8E8">
                    <asp:DropDownList ID="ddlUser" runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td bgcolor="#E7E8E8" style="width: 200px; font-weight: bold;">
                    Substitutes:
                </td>
                <td bgcolor="#E7E8E8">
                    <asp:DropDownList ID="ddlSubstitutes" runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td bgcolor="#E7E8E8" style="height: 90px">
                </td>
                <td bgcolor="#E7E8E8">
                    <asp:CheckBox ID="cbEnable" runat="server" AutoPostBack="True" OnCheckedChanged="cbEnable_CheckedChanged"
                        Text="Enable" Visible="False" />
                   <br /> <asp:Label ID="Label6" runat="server" Text="To date"></asp:Label>
                    <asp:TextBox autocomplete="off" ID="txtSubstitutesDate" onclick="WdatePicker();"
                        runat="server"></asp:TextBox>
                    <br />
                    <br />
                    <asp:Button ID="btnSave" runat="server" CssClass="button" Text="Save" OnClick="btnSave_Click"
                        OnClientClick="return confirm('Are you sure you want to save?');" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:DataGrid ID="dgList" HeaderStyle-BackColor="#2E8AC5" HeaderStyle-Font-Bold="true"
                        HeaderStyle-Height="32px" Width="100%" OnLoad="dgLoad" AutoGenerateColumns="False"
                        runat="server">
                        <Columns>
                            <asp:BoundColumn DataField="rownum" HeaderText="No.">
                                <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            </asp:BoundColumn>
                            <asp:TemplateColumn HeaderText="UserName" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("USERNAME") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                            <asp:TemplateColumn HeaderText="SubstitutesUser" ItemStyle-HorizontalAlign="Left"
                                HeaderStyle-HorizontalAlign="Left">
                                <ItemTemplate>
                                    <asp:Label ID="Label3" runat="server" Text='<%#Eval("SUBSTITUTESUSER") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            </asp:TemplateColumn>
                            <asp:TemplateColumn HeaderText="SubstitutesEnable" Visible="false" ItemStyle-HorizontalAlign="Left"
                                HeaderStyle-HorizontalAlign="Left">
                                <ItemTemplate>
                                    <asp:Label ID="Label4" runat="server" Text='<%#Eval("SUBSTITUTESENABLE").ToString()=="1"?"Yes":"No" %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            </asp:TemplateColumn>
                            <asp:TemplateColumn HeaderText="SubstitutesDate" ItemStyle-HorizontalAlign="Left"
                                HeaderStyle-HorizontalAlign="Left">
                                <ItemTemplate>
                                    <asp:Label ID="Label5" runat="server" Text='<%# Eval("ti") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            </asp:TemplateColumn>
                            <asp:HyperLinkColumn Text="Delete" DataNavigateUrlField="ID" Visible="false" DataNavigateUrlFormatString="javascript:Del('{0}');"
                                HeaderText="Delete">
                                <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            </asp:HyperLinkColumn>
                            <asp:TemplateColumn HeaderText="Delete" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
                                <ItemTemplate>
                                    <img src="../Images/newimg/delete.png" title="Delete" onclick="<%#"javascript:Del("+Eval("ID")+");" %>" />
                                </ItemTemplate>
                            </asp:TemplateColumn>
                        </Columns>
                        <HeaderStyle BackColor="#E7E8E8" Font-Bold="True" Height="32px"></HeaderStyle>
                    </asp:DataGrid>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
